Example plots

Author

David Innes

Here are just a few examples of what is possible and relevant for PowerPoint. At the end, there is an interactive plot which can be published with more advanced tools such as https://quarto.org/docs/presentations/revealjs/.

Also see https://www.data-to-viz.com/ for different ways of visualising your data depending on what type of data it is.

Animate

Turn plots into animated .gif files that can be used like normal images inside of powerpoint.

These versions are continuously looping, but they can be set to animate once and stays on your screen.

Annotate

Add manual annotations to show important values.

Represent distributions

This example represents thousands of data points and also uses colour to differentiate real (observed) values from model predictions.

Interactive

Harder to use with presentations, but useful for various other applications.

Hover over data points to see more information and zoom in by clicking and dragging.

Code
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(ggplot2))

file_in <- readRDS("./combined_preds_fitted.rds")

p <- file_in %>% 
  filter(ID %in% c("722_2", "752_4")) %>%
  ggplot()+
   geom_point(aes(x=DIM, y=my, group = DIM), alpha = 0.3)+
      geom_line(aes(x=DIM, y=.fitted, colour = Model), linewidth = 1)+
      scale_x_continuous(n.breaks = 10)+
      ggpubr::theme_classic2()+
      viridis::scale_colour_viridis(discrete = TRUE, option = "H", begin = 0.15, end = 0.85)+
      facet_wrap(facets = "ID", ncol=3, scales='free_x')+
      scale_y_continuous( n.breaks = 10, limits = c(0,60))+
      ylab("Milk Yield (kg/d)")+
      xlab("Days in milk (DIM)")
  
  
plotly::ggplotly(p, width = 800)